<div class="row">
    <div class="col-md-3 col-sm-6 col-xs-12">
        <div class="info-box">
            <span class="info-box-icon bg-aqua"><i class="fa fa-usd"></i></span>

            <div class="info-box-content">
                <span class="info-box-text">上月指标</span>
                <span class="info-box-number"><?php echo $data['m'];?></span>
            </div>
            <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
    </div>
    <!-- /.col -->
    <div class="col-md-3 col-sm-6 col-xs-12">
        <div class="info-box">
            <span class="info-box-icon bg-green"><i class="fa fa-bar-chart-o"></i></span>

            <div class="info-box-content">
                <span class="info-box-text">上月已收款营业额</span>
                <span class="info-box-number"><?php echo $data['price'];?></span>
            </div>
            <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
    </div>
    <!-- /.col -->
    <div class="col-md-3 col-sm-6 col-xs-12">
        <div class="info-box">
            <span class="info-box-icon bg-yellow"><i class="fa fa-pie-chart"></i></span>

            <div class="info-box-content">
                <span class="info-box-text">上月未收款营业额</span>
                <span class="info-box-number"><?php echo $data['wf'] == "" ? "0" : $data['wf'];?></span>
            </div>
            <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
    </div>
    <!-- /.col -->
    <div class="col-md-3 col-sm-6 col-xs-12">
        <div class="info-box">
            <span class="info-box-icon bg-red"><i class="fa fa-spinner"></i></span>

            <div class="info-box-content">
                <span class="info-box-text">完成率</span>
                <span class="info-box-number"><?php echo $data['price'] / $data['m'] * 100?>%</span>
            </div>
            <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
    </div>
    <!-- /.col -->
</div>

<div class="row">

    <!-- 左边 -->
    <div class="col-lg-6">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">文化广场店</h3> <small>上月数据：<?php echo date('Y-');echo date('m')-1;echo '-31'; ?></small>
                <span class="pull-right">
                    上月已入账营业额：<b><?php echo $data['wh'];?></b>，
                    上月未收营业额：<b><?php echo $data['wfwh'];?></b>
                </span>
            </div><!-- /.box-header -->
            <div class="box-body">
                <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                    <div class="row">
                        <div class="col-sm-6"></div>
                        <div class="col-sm-6"></div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <table class="table table-bordered table-hover dataTable">
                                <thead>
                                <tr role="row">
                                    <th class="sorting">销售员</th>
                                    <th class="sorting">时间</th>
                                    <th class="sorting">商品</th>
                                    <th class="sorting">价格</th>
                                    <th class="sorting">订单信息</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php
                                foreach($data['query'] as $k){
                                    $i = $k['mprice'] == "未付" ? "wastebook-wf" : "";
                                    if ($k['addr'] == "文化广场店"){ ?>
                                        <tr class="<?php echo $i;?>">
                                            <td class="wastebook-item"><?php echo $k['name']?></td>
                                            <td class="wastebook-item"><?php echo $k['time']?></td>
                                            <td class="wastebook-item">
                                                <span class="label label-warning">已付款</span>
                                                <?php
                                                echo $k['item'];

                                                if ($k['g_id'] != "") {
                                                    echo " <b style='color:red';>(" . $k['g_id'] . ")</b>";
                                                }

                                                ?>
                                            </td>
                                            <td class="wastebook-item">
                                                <span class="label label-success">$<?php echo $k['price']?></span>
                                            </td>
                                            <td>
                                                <button class="btn btn-info" data-toggle="modal" data-target="#W_id_<?php echo $k['id']; ?>">明细 <i class="fa fa-arrow-circle-right"></i><iframe id="tmp_downloadhelper_iframe" style="display: none;"></iframe></button>
                                                <div class="modal" id="W_id_<?php echo $k['id']; ?>">
                                                    <div class="modal-dialog">
                                                        <div class="modal-content">
                                                            <div class="modal-header">
                                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                                <h4 class="modal-title">单据信息表</h4>
                                                                <iframe id="tmp_downloadhelper_iframe" style="display: none;"></iframe></div>
                                                            <div class="modal-body">
                                                                <table class="table table-bordered table-hover dataTable">
                                                                    <thead>
                                                                    <th class="sorting">名称</th>
                                                                    <th class="sorting">详细信息</th>
                                                                    </thead>
                                                                    <tbody>
                                                                    <tr>
                                                                        <td>订单编号</td>
                                                                        <td class="wastebook-item"><?php echo $k['entry']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>订单时间</td>
                                                                        <td class="wastebook-item"><?php echo $k['time']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>店铺名称</td>
                                                                        <td class="wastebook-item"><?php echo $k['addr']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>销售员</td>
                                                                        <td class="wastebook-item"><?php echo $k['name']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>商品类型</td>
                                                                        <td class="wastebook-item"><?php echo $k['type']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>商品名称</td>
                                                                        <td class="wastebook-item"><?php echo $k['item']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>购买数量</td>
                                                                        <td class="wastebook-item"><?php echo $k['num']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>商品价格</td>
                                                                        <td class="wastebook-item">
                                                                            <span class="label label-danger">$<?php echo $k['price']?></span>
                                                                        </td>
                                                                    </tr>
                                                                    <?php
                                                                    if ($k['v_id'] != ""){
                                                                        ?>
                                                                        <tr>
                                                                            <td>会员号</td>
                                                                            <td class="wastebook-item"><?php echo $k['v_id']?></td>
                                                                        </tr>
                                                                    <?php } ?>
                                                                    <?php
                                                                    if ($k['g_id'] != ""){
                                                                        ?>
                                                                        <tr>
                                                                            <td>公司名称</td>
                                                                            <td class="wastebook-item"><?php echo $k['g_id']?></td>
                                                                        </tr>
                                                                    <?php } ?>
                                                                    <tr>
                                                                        <td>交易方式</td>
                                                                        <td class="wastebook-item"><?php echo $k['mprice']?></td>
                                                                    </tr>
                                                                    <?php
                                                                    if ($k['add_rewards'] != ""){
                                                                        ?>
                                                                        <tr>
                                                                            <td>获得积分</td>
                                                                            <td class="wastebook-item"><?php echo $k['add_rewards']?></td>
                                                                        </tr>
                                                                    <?php } ?>
                                                                    <?php
                                                                    if ($k['del_rewards'] != ""){
                                                                        ?>
                                                                        <tr>
                                                                            <td>消费积分</td>
                                                                            <td class="wastebook-item"><?php echo $k['del_rewards']?></td>
                                                                        </tr>
                                                                    <?php } ?>
                                                                    <tr>
                                                                        <td>备注</td>
                                                                        <td class="wastebook-item"><?php echo $k['info']?></td>
                                                                    </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                            <div class="modal-footer">
                                                                <button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
                                                                <!-- 流水执行 -->
                                                                <?php if ($_SESSION['ADMIN']) { ?>
                                                                    <button type="button" class="btn btn-primary btn-xs" onclick='calendar_set("ok",<?php echo $id ?>)'> 修改</button>
                                                                <?php } ?>
                                                                <button type="button" class="btn btn-danger  btn-xs" onclick='wastebook_set("del",<?php echo $k['id'] ?>)'> 退货</button>
                                                            </div>
                                                        </div><!-- /.modal-content -->
                                                    </div><!-- /.modal-dialog -->
                                                </div>
                                            </td>
                                        </tr>
                                        <?php /*endaddr*/} /*endforeach*/ }?>
                                </tbody>
                                <tfoot>
                                <tr role="row">
                                    <th class="sorting">销售员</th>
                                    <th class="sorting">时间</th>
                                    <th class="sorting">商品</th>
                                    <th class="sorting">价格</th>
                                    <th class="sorting">订单信息</th>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div><!-- /.box-body -->
            </div>
        </div>
    </div>

    <!-- 右边 -->
    <div class="col-lg-6">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">白露店</h3> <small>上月数据：<?php echo date('Y-');echo date('m')-1;echo '-31'; ?></small>
                <span class="pull-right">
                    上月已入账营业额：<b><?php echo $data['bailu'];?></b>，
                    上月未收营业额：<b><?php echo $data['wfbailu'];?></b>
                </span>
            </div><!-- /.box-header -->
            <div class="box-body">
                <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                    <div class="row">
                        <div class="col-sm-6"></div>
                        <div class="col-sm-6"></div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <table class="table table-bordered table-hover dataTable">
                                <thead>
                                <tr role="row">
                                    <th class="sorting">销售员</th>
                                    <th class="sorting">时间</th>
                                    <th class="sorting">商品</th>
                                    <th class="sorting">价格</th>
                                    <th class="sorting">订单信息</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php
                                foreach($data['query'] as $k){
                                    $i = $k['mprice'] == "未付" ? "wastebook-wf" : "";
                                    if ($k['addr'] == "白露店"){ ?>
                                        <tr class="w-hi <?php echo $i;?>">
                                            <td class="wastebook-item"><?php echo $k['name']?></td>
                                            <td class="wastebook-item"><?php echo $k['time']?></td>
                                            <td class="wastebook-item">
                                                <span class="label label-warning">已付款</span>
                                                <?php
                                                echo $k['item'];

                                                if ($k['g_id'] != "") {
                                                    echo " <b style='color:red';>(" . $k['g_id'] . ")</b>";
                                                }

                                                ?>
                                            </td>
                                            <td class="wastebook-item">
                                                <span class="label label-success">$<?php echo $k['price']?></span>
                                            </td>
                                            <td>
                                                <button class="btn btn-info" data-toggle="modal" data-target="#W_id_<?php echo $k['id']; ?>">明细 <i class="fa fa-arrow-circle-right"></i><iframe id="tmp_downloadhelper_iframe" style="display: none;"></iframe></button>
                                                <div class="modal" id="W_id_<?php echo $k['id']; ?>">
                                                    <div class="modal-dialog">
                                                        <div class="modal-content">
                                                            <div class="modal-header">
                                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                                <h4 class="modal-title">单据信息表</h4>
                                                                <iframe id="tmp_downloadhelper_iframe" style="display: none;"></iframe></div>
                                                            <div class="modal-body">
                                                                <table class="table table-bordered table-hover dataTable">
                                                                    <thead>
                                                                    <th class="sorting">名称</th>
                                                                    <th class="sorting">详细信息</th>
                                                                    </thead>
                                                                    <tbody>
                                                                    <tr>
                                                                        <td>订单编号</td>
                                                                        <td class="wastebook-item"><?php echo $k['entry']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>订单时间</td>
                                                                        <td class="wastebook-item"><?php echo $k['time']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>店铺名称</td>
                                                                        <td class="wastebook-item"><?php echo $k['addr']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>销售员</td>
                                                                        <td class="wastebook-item"><?php echo $k['name']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>商品类型</td>
                                                                        <td class="wastebook-item"><?php echo $k['type']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>商品名称</td>
                                                                        <td class="wastebook-item"><?php echo $k['item']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>购买数量</td>
                                                                        <td class="wastebook-item"><?php echo $k['num']?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>商品价格</td>
                                                                        <td class="wastebook-item">
                                                                            <span class="label label-danger">$<?php echo $k['price']?></span>
                                                                        </td>
                                                                    </tr>
                                                                    <?php
                                                                    if ($k['v_id'] != ""){
                                                                        ?>
                                                                        <tr>
                                                                            <td>会员号</td>
                                                                            <td class="wastebook-item"><?php echo $k['v_id']?></td>
                                                                        </tr>
                                                                    <?php } ?>
                                                                    <?php
                                                                    if ($k['g_id'] != ""){
                                                                        ?>
                                                                        <tr>
                                                                            <td>公司名称</td>
                                                                            <td class="wastebook-item"><?php echo $k['g_id']?></td>
                                                                        </tr>
                                                                    <?php } ?>
                                                                    <tr>
                                                                        <td>交易方式</td>
                                                                        <td class="wastebook-item"><?php echo $k['mprice']?></td>
                                                                    </tr>
                                                                    <?php
                                                                    if ($k['add_rewards'] != ""){
                                                                        ?>
                                                                        <tr>
                                                                            <td>获得积分</td>
                                                                            <td class="wastebook-item"><?php echo $k['add_rewards']?></td>
                                                                        </tr>
                                                                    <?php } ?>
                                                                    <?php
                                                                    if ($k['del_rewards'] != ""){
                                                                        ?>
                                                                        <tr>
                                                                            <td>消费积分</td>
                                                                            <td class="wastebook-item"><?php echo $k['del_rewards']?></td>
                                                                        </tr>
                                                                    <?php } ?>
                                                                    <tr>
                                                                        <td>备注</td>
                                                                        <td class="wastebook-item"><?php echo $k['info']?></td>
                                                                    </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                            <div class="modal-footer">
                                                                <button type="button" class="btn btn-info pull-left" data-dismiss="modal">关闭</button>
                                                                <!-- 流水执行 -->
                                                                <?php if ($_SESSION['ADMIN']) { ?>
                                                                    <button type="button" class="btn btn-success btn-xs" onclick='calendar_set("ok",<?php echo $id ?>)'> 修改</button>
                                                                <?php } ?>
                                                                <button type="button" class="btn btn-danger  btn-xs" onclick='wastebook_set("del",<?php echo $k['id'] ?>)'> 退货</button>
                                                            </div>
                                                        </div><!-- /.modal-content -->
                                                    </div><!-- /.modal-dialog -->
                                                </div>
                                            </td>
                                        </tr>
                                        <?php /*endaddr*/} /*endforeach*/ }?>
                                </tbody>
                                <tfoot>
                                <tr role="row">
                                    <th class="sorting">销售员</th>
                                    <th class="sorting">时间</th>
                                    <th class="sorting">商品</th>
                                    <th class="sorting">价格</th>
                                    <th class="sorting">订单信息</th>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div><!-- /.box-body -->
            </div>
        </div>
    </div>

</div>